namespace Test.Robotics.Runtime
{
    using System;
    using Microsoft.Robotics.Tracing;

    /// <summary>
    /// Mock trace writer for testing
    /// </summary>
    public class MockFormatter : ITraceFormatter
    {
        /// <summary>
        /// Gets or sets date passed as a parameter to formatter
        /// </summary>
        public DateTime Date { get; set; }

        /// <summary>
        /// Gets or sets level passed as a parameter to formatter
        /// </summary>
        public TraceContext Level { get; set; }

        /// <summary>
        /// Gets or sets Context passed as a parameter to formatter
        /// </summary>
        public TraceContext Context { get; set; }

        /// <summary>
        /// Gets or sets Format String passed as a parameter to formatter
        /// </summary>
        public string FormatString { get; set; }

        /// <summary>
        /// Gets or sets argument list passed as a parameter to formatter
        /// </summary>
        public object[] Args { get; set; }

        /// <summary>
        /// Store objects for inspection
        /// </summary>
        /// <param name="dateTime">Date time</param>
        /// <param name="level">Trace level</param>
        /// <param name="context">Trace context</param>
        /// <param name="format">Input string format</param>
        /// <param name="args">The arguments</param>
        /// <returns>Formatted trace string</returns>
        public string Format(DateTime dateTime, TraceContext level, TraceContext context, string format, params object[] args)
        {
            this.Date = dateTime;
            this.Level = level;
            this.Context = context;
            this.FormatString = format;
            this.Args = args;

            return "does not matter";
        }
    }
}
